{
 "cells": [
  {
   "cell_type": "code",
   "execution_count": null,
   "id": "b0b039ac-9bca-4099-a1e8-a4a84fb723ab",
   "metadata": {},
   "outputs": [],
   "source": [
    "import tensorflow  as tf\n",
    "import numpy as np\n",
    "import matplotlib.pyplot as plt\n",
    "import os\n",
    "def read_image_flienames(data_dir):\n",
    "    cat_dir=data_dir+'cat/'\n",
    "    dog_dir=data_dir+'dog/'\n",
    "    cat_filenames=tf.constant([cat_dir+fn for fn in os.listdir(cat_dir)])\n",
    "    dog_filenames=tf.constant([dog_dir+fn for fn in os.listdir(dog_dir)])\n",
    "    filenames=tf.concat([cat_filenames,dog_filenames],axis=-1)\n",
    "    labels=tf.concat(tf.zeros(cat_filenames.shape,dtype=tf.int32),tf.ones(dog_filenames.shape,dtype=tf.int32)],axis=-1)\n",
    "    return filenames,labels\n",
    "def decode_image_and_resize(filename,label):\n",
    "    image_string=tf.io.read_file(filename)\n",
    "    image_decoded=tf.image.decode_jpeg(image_string)\n",
    "    image_resized=tf.image.resize(image_decoded,[224,224])/255.0\n",
    "    return image_resized,label\n",
    "buffer_size=4000\n",
    "batch_size=8\n",
    "def prepare_dataset(data_dir):\n",
    "    filenames,labels=read_image_flienames(data_dir)\n",
    "    data\n",
    "\n",
    "    "
   ]
  }
 ],
 "metadata": {
  "kernelspec": {
   "display_name": "Python 3 (ipykernel)",
   "language": "python",
   "name": "python3"
  },
  "language_info": {
   "codemirror_mode": {
    "name": "ipython",
    "version": 3
   },
   "file_extension": ".py",
   "mimetype": "text/x-python",
   "name": "python",
   "nbconvert_exporter": "python",
   "pygments_lexer": "ipython3",
   "version": "3.13.5"
  }
 },
 "nbformat": 4,
 "nbformat_minor": 5
}
